function formatTime(time) {
  if (typeof time !== 'number' || time < 0) {
    return time
  }

  var hour = parseInt(time / 3600)
  time = time % 3600
  var minute = parseInt(time / 60)
  time = time % 60
  var second = time

  return ([hour, minute, second]).map(function (n) {
    n = n.toString()
    return n[1] ? n : '0' + n
  }).join(':')
}

var sleep=function sleep (time) {
  return new Promise((resolve) => setTimeout(resolve, time));
}

/**
 * 跳转到登录页面
 */
var goLoginPage= function goLoginPage(){
  wx.navigateTo({
    url: '/pages/authorize/phone'
  })
}

module.exports = {
  formatTime: formatTime,
  sleep: sleep,
  goLoginPage: goLoginPage
}